package com.qidian.zl.paper.test;

import com.qidian.zl.paper.factory.ServiceFactory;
import com.qidian.zl.paper.service.FieldService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

//@WebServlet("/deletelField")
public class DeletelFieldServlet extends HttpServlet {
    private FieldService fieldService= ServiceFactory.getFieldService();
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Long fieldId = Long.valueOf(request.getParameter("fieldId"));
        fieldService.delete(fieldId);
    }
}
